FROM node:lts AS build

WORKDIR /app

COPY . .

RUN npm install --registry=https://registry.npmmirror.com

RUN npm run build

FROM node:lts

WORKDIR /app

COPY --from=build /app/dist ./dist
COPY --from=build /app/bootstrap.js ./
COPY --from=build /app/package.json ./

#RUN apk add --no-cache tzdata

ENV TZ="Asia/Shanghai"

RUN npm install --production -registry=https://registry.npmmirror.com

# 如果端口更换，这边可以更新一下
EXPOSE 7001

CMD ["npm", "run", "start"]